package ugc.data;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Map;

import library.office.ExcelReader;

import org.junit.Test;

/**
 * @author waynechen May 14, 2012 2:34:50 PM
 */
public class DataCopy {

	private String path = "/home/waynechen/Desktop/";

	@Test
	public void hideData() throws IOException {
		File file = new File(path + "update.sql");
		FileWriter writer = new FileWriter(file);

		path += "经纬度校对有问题的.xls";
		ExcelReader reader = new ExcelReader(path);
		reader.openExcel();
		while (reader.hasNext()) {
			Map<String, Object> map = reader.next();
			String addrName = (map.get("景点名") + "").trim();
			String sql = String.format("update address set is_valid=2 where name='%s';", addrName);
			writer.write(sql + "\n");
		}
		writer.flush();
		writer.close();
	}
}

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//